extends PlayStatusManage

enum Status{Idle=1,Walk,Jump,Charge,Fall,OnWall,Celling,Death}

@onready var status_idle:PlayStatusInterface = $StatusIdle
@onready var status_walk:PlayStatusInterface  = $StatusWalk
@onready var status_jump:PlayStatusInterface  = $StatusJump
@onready var status_charge:PlayStatusInterface  = $StatusCharge
@onready var status_fall:PlayStatusInterface  = $StatusFall
@onready var status_onwall:PlayStatusInterface  = $StatusOnwall
@onready var status_celling:PlayStatusInterface  = $StatusCelling
@onready var status_death:PlayStatusInterface  = $StatusDeath

func _ready():
	add_status_node(Status.Idle, status_idle, "Idle")
	add_status_node(Status.Walk, status_walk, "Walk")
	add_status_node(Status.Jump, status_jump, "Jump")
	add_status_node(Status.Charge, status_charge, "Charge")
	add_status_node(Status.Fall, status_fall, "Fall")
	add_status_node(Status.OnWall, status_onwall, "OnWall")
	add_status_node(Status.Celling, status_celling, "Celling")
	add_status_node(Status.Death, status_death, "Death")

	set_default(Status.Idle)

func to_idle():
	change_status(Status.Idle)
func to_walk():
	change_status(Status.Walk)
func to_jump():
	change_status(Status.Jump)
func to_charge():
	change_status(Status.Charge)
func to_fall():
	change_status(Status.Fall)
func to_onwall():
	change_status(Status.OnWall)
func to_celling():
	change_status(Status.Celling)
func to_death():
	change_status(Status.Death)

func is_idle():
	return is_status(Status.Idle)
func is_walk():
	return is_status(Status.Walk)
func is_jump():
	return is_status(Status.Jump)
func is_charge():
	return is_status(Status.Charge)
func is_fall():
	return is_status(Status.Fall)
func is_onwall():
	return is_status(Status.OnWall)
func is_celling():
	return is_status(Status.Celling)
func is_death():
	return is_status(Status.Death)
	
func _process(delta):
	current_node.run_process(delta)
func _physics_process(delta):
	current_node.run_physics_process(delta)
